import { EntitySchema } from '@mikro-orm/core';

export class LeSubscribeTemplate {
  id!: string;
  AppID!: string;
  tplName!: string;
  tplId!: string;
  platform?: string;
  createdTime?: number = 0;
  updatedTime?: number = 0;
  deletedTime?: number = 0;
  isDeleted?: number = 0;
}

export const LeSubscribeTemplateSchema = new EntitySchema({
  class: LeSubscribeTemplate,
  properties: {
    id: { primary: true, type: 'string', columnType: 'bigint' },
    AppID: { type: 'string', fieldName: 'AppID', length: 50 },
    tplName: { type: 'string', length: 50 },
    tplId: { type: 'string', length: 50 },
    platform: { type: 'string', length: 8, nullable: true, default: 'weapp' },
    createdTime: { type: 'number', nullable: true, default: 0 },
    updatedTime: { type: 'number', nullable: true, default: 0 },
    deletedTime: { type: 'number', nullable: true, default: 0 },
    isDeleted: { type: 'number', columnType: 'tinyint', nullable: true, default: 0 },
  },
});
